{% extends 'TopxiaWebBundle::layout.html.twig' %}

{% block title %}
  {% if not level.id %}全部会员课程{% else %}{{ level.name }} 课程{% endif %} 第{{ app.request.get('page', 1)}}页- {{ parent() }}
{% endblock %}

{% block content %}

<div class="es-row-wrap memberzone">
  <div class="row">
    <div class="col-md-12">
      <div class="page-header"><h1>会员专区</h1></div>
      <ol class="breadcrumb">
        <li><a href="{{ path('vip') }}">会员专区</a></li>
        <li class="active">会员课程</li>
      </ol>
    </div>
  </div>
  <div class="row row-3-9">
    <div class="col-md-3">
      <ul class="nav nav-pills nav-stacked">
        <li {% if not level.id %}class="active"{% endif %} ><a href="{{ path('vip_course_explore') }}">全部会员课程</a></li>
        {% for lev in levels %}
          <li {% if level.id == lev.id %}class="active"{% endif %}>
            <a href="{{ path('vip_course_explore', { levelId:lev.id }) }}">
            {{ lev.name }}课程</a>
          </li>
        {% endfor %}
      </ul>
    </div>

    <div class="col-md-9">
      <div class="btn-group btn-group-sm">
        <a href="{{ path('vip_course_explore', { levelId:level.id|default(0), sort:'latest'} ) }}" 
        class="btn btn-default {% if sort == 'latest' %}active{% endif %}">最新</a>        
        <a href="{{ path('vip_course_explore', { levelId:level.id|default(0), sort:'popular'} ) }}" 
        class="btn btn-default {% if sort == 'popular' %}active{% endif %}">热门</a> 
      </div>

      <div class="es-box-body">
        {% if courses %}
          {{ render(controller('TopxiaWebBundle:Course:coursesBlock', {courses:courses, view: 'grid'})) }}
          {{ web_macro.paginator(paginator) }} 
        {% else %}
          <div class="empty">还没有发布的课程</div>
        {% endif %}
      </div>
    </div>
  </div>

</div>

{% endblock %}
